package dao

import (
	"gitee.com/enzolwb/my-web-scaffold/models"
	"github.com/jinzhu/gorm"
)

type IArticleRepository interface {
	// DB
	ExistArticleByID(id int) (bool, error)
	GetArticleTotal(maps interface{}) (int, error)
	GetArticles(pageNum int, pageSize int, maps interface{}) ([]*models.Article, error)
	GetArticle(id int) (*models.Article, error)
	EditArticle(id int, data interface{}) error
	AddArticle(data map[string]interface{}) error
	DeleteArticle(id int) error
	CleanAllArticle() error
	// Cache

	// Mq

}

type ArticleRepository struct {
	mysqlDb *gorm.DB
	//redis
	//mq
}

//创建cartRepository
/*func NewCartRepository(db *gorm.DB) IArticleRepository {
	return &ArticleRepository{mysqlDb: db}
}*/
